#include "MetaObjectHeader.h"

#include <Core/ClassMeta.h>

namespace MOE
{
	namespace System
	{

		// Constructor. Must be constructed with a class meta.
		MetaObjectHeader::MetaObjectHeader(const Core::ClassMeta& classMeta)
			: mClassMeta(classMeta)
		{
		}

		// Intended to be inherited.
		MetaObjectHeader::~MetaObjectHeader()
		{
		}

		// Query if my class meta is either the same as the other class meta, or an inherited subclass of it.
		bool MetaObjectHeader::IsOfType(const Core::ClassMeta& otherMeta) const
		{
			return (&mClassMeta == &otherMeta) || mClassMeta.IsSubclassOf(otherMeta);
		}
	}
}
